Method and apparatus for image encoding with intra prediction mode

ABSTRACT

A method for encoding an intra prediction mode according to the present invention selects an intra prediction mode for a current block, determines the number of valid MPM candidates by checking the validity of MPM candidates of the current block, and if the number of valid MPM candidates is less than a previously set number, adds additional intra prediction modes as MPM candidates. MPM candidates can be adaptively added on the basis of the directionality of valid MPM candidates. Additionally, during the encoding of residual intra prediction modes, residual intra prediction modes are realigned on the basis of the directionality of valid MPM candidates. Accordingly, the present invention allows the information for encoding the intra prediction mode of the current block to be minimized by adding MPM candidates or realigning the residual intra prediction modes on the basis of the directionality of valid MPM candidates.

CROSS-REFERENCE TO RELATED PATENT APPLICATIONS

This application is a 35 U.S.C. §371 national stage filing ofInternational Application No. PCT/KR2012/003073, filed Apr. 20, 2012,which claims the benefit of Korean Patent Application No.10-2011-0108448, filed on Oct. 24, 2011. The contents of each of theforegoing applications are incorporated herein by reference in theirentireties.

TECHNICAL FIELD

The present invention relates to an image encoding method and an imageencoding device in an intra prediction mode, and more particularly, to amethod and a device that generates a most probable mode (MPM) groupusing intra prediction modes of a left block and a top block of acurrent block and encodes an intra prediction mode using the MPM group.

BACKGROUND ART

Image data has to be encoded to efficiently store or transmit the imagedata. MPEG-1, MPEG-2, MPEG-4, H.264/MPEG-4 AVC (Advanced Video Coding),and the like are known as techniques of encoding image data. In thesetechniques, a picture is divided into macro blocks, it is determinedwhich of intra encoding or inter encoding should be performed in theunit of the macro blocks, and the macro blocks are encoded using thedetermined encoding method.

In H.264 which is a latest image compressing technique, intra predictionis performed to enhance the efficiency of the intra encoding. That is,instead of referring to a reference picture to encode a current block, aprediction block is generated using pixel values spatially neighboringthe current block to be encoded. Specifically, an intra prediction modehaving a small distortion is selected through comparison with anoriginal macro block using the neighboring pixel values and theprediction block of the current block to be encoded is created using theselected intra prediction mode and the neighboring pixel values. Aresidual block including difference signals between the current blockand the prediction block is created and the residual block istransformed, quantized, and entropy-encoded. The intra prediction modeused to create the prediction block is also encoded.

However, in H.264, the intra prediction mode of a current block isencoded regardless of directivity of the intra prediction modes of theleft and top blocks of the current block and there is thus a problem inthat the encoding efficiency is low. When the number of intra predictionmodes increases to enhance the encoding efficiency of a residual block,there is a need for an intra prediction encoding method havingefficiency higher than that of the intra prediction mode encoding methodof H.264.

SUMMARY OF THE INVENTION Technical Problem

An object of the invention is to provide a method and a device which canenhance compression efficiency of an image by generating an MPM groupusing intra prediction modes of left and top blocks of a current blockand encoding an intra prediction mode of the current block using the MPMgroup.

Solution to Problem

According to an aspect of the invention, there is provided an imageencoding method including: determining an intra prediction mode of acurrent block; constructing a first group using valid intra predictionmodes of left and top blocks of the current block; determining to whichof the first group and a second group the intra prediction mode of thecurrent block belongs; encoding a prediction mode index corresponding tothe intra prediction mode of the current block in the second group whenthe intra prediction mode of the current block belongs to the secondgroup; and setting the prediction mode index equal to 0 or 1—when thesecond group includes the at least one non-directional mode and theintra prediction mode of the current block is a non-directional mode andbelongs to the second group.

In the image encoding method, when the intra prediction modes of theleft and top blocks of the current block are all valid and are not equalto each other, the first group may include the intra prediction modes ofthe left and top blocks and one intra prediction mode determineddepending on the intra prediction modes of the left and top blocks maybe added to the first group.

In the image encoding method, when the intra prediction modes of theleft and top blocks of the current block are all non-directional modes,the added intra prediction mode may be a vertical mode.

In the image encoding method, when one of the intra prediction modes ofthe left and top blocks of the current block is a non-directional modeand the other is a directional mode, the added intra prediction mode maybe the other non-directional mode.

In the image encoding method, when the intra prediction modes of theleft and top blocks of the current block are all valid and are equal toeach other, the first group may include the intra prediction mode andtwo intra prediction modes determined depending on the intra predictionmode may be added to the first group. When the second group includes twonon-directional modes, the non-directional modes may have an indexsmaller than those of the other directional modes.

Advantageous Effects

In the image encoding method according to the invention, the intraprediction mode of the current block is determined, the first groupincluding three intra prediction modes are constructed using the validintra prediction modes of the left and top blocks of the current block,information indicating the first group and the prediction mode indexindicating a specific intra prediction mode in the first group aredetermined when the intra prediction mode of the current block belongsto the first group, and information indicating the second group and theprediction mode index indicating a specific intra prediction mode in thesecond group are determined when the intra prediction mode of thecurrent block belongs to the second group including intra predictionmodes other than the intra prediction modes belonging to the firstgroup. When at least one of the non-directional modes belongs to thesecond group, the smallest indices are assigned to the non-directionalmodes.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a moving image encoding deviceaccording to an embodiment of the invention.

FIG. 2 is a block diagram illustrating a moving image decoding deviceaccording to another embodiment of the invention.

FIG. 3 is a diagram illustrating a method of creating an intraprediction block in the moving image decoding device according to theembodiment of the invention.

FIG. 4 is a conceptual diagram illustrating intra prediction modesaccording to the embodiment of the invention.

FIG. 5 is a diagram illustrating an intra prediction mode encodingsequence according to the embodiment of the invention.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

Hereinafter, various embodiments of the invention will be described indetail with reference to the accompanying drawings. The invention can bemodified in various forms and can have various embodiments. Theembodiments are not intended for limiting the invention, but it shouldbe understood that the invention includes all the modifications,equivalents, and replacements belonging to the spirit and the technicalscope of the invention. In description of the invention with referenceto the drawings, like constituents are referenced by like referencenumerals.

A moving image encoding device and a moving image decoding deviceaccording to the invention may be user terminals such as a personalcomputer, a notebook PC, a personal digital assistant, a portablemultimedia player, a smart phone, a wireless communication terminal, anda TV or servers providing services. The moving image encoding device andthe moving image decoding device may be apparatuses having acommunication device such as a communication modem for communicatingwith various apparatuses or wireless or wired communication networks, amemory storing various programs and data for encoding and decoding animage, and a microprocessor performing the programs to performoperations and controls.

FIG. 1 is a block diagram illustrating a moving image encoding deviceaccording to an embodiment of the invention.

The moving image encoding device 100 according to the embodiment of theinvention includes an intra prediction module 110, an inter predictionmodule 120, a transform and quantization module 130, an entropy encodingmodule 140, an inverse quantization and inverse transform module 150, apost-processing module 160, a picture buffer 170, a subtraction module190, and an addition module 195.

The intra prediction module 110 creates an intra prediction block usingreconstructed pixels of a picture or slice to which a current blockbelongs. The intra prediction module 110 selects one of a predeterminednumber of intra prediction modes depending on the size of the currentblock to be prediction-encoded and creates a prediction block using theselected intra prediction mode.

The inter prediction module 120 performs a motion estimation operationusing reference pictures stored in the picture buffer 170 and determinesreference picture indices and motion vectors for the motion estimationoperation. Then, the inter prediction module 120 creates an interprediction block of the current block using the reference pictureindices and the motion vectors.

The transform and quantization module 130 transforms and quantizes aresidual block of the prediction block created by the intra predictionmodule 110 or the inter prediction module 120. The transform isperformed using one-dimensional transform matrixes in the horizontal andvertical directions. The residual block for intra prediction istransformed using transform matrixes determined depending on the size ofthe transform block (that is, the size of the residual block) and theintra prediction mode. The residual block for inter prediction istransformed using predetermined transform matrixes.

The transform and quantization module 130 quantizes the transform blockusing a quantization step size. The quantization step size can bechanged by coding units equal to or larger than a predetermined size.

The quantized transform block is supplied to the inverse quantizationand inverse transform module 150 and the entropy encoding module 140.

The inverse quantization and inverse transform module 150 inverselyquantizes the quantized transform block and inversely transform theinversely-quantized transform block to reconstruct the residual block.The addition module adds the residual block reconstructed by the inversequantization and inverse transform module 150 and the prediction blockfrom the intra prediction module 110 or the inter prediction module 120to creates a reconstructed block.

The post-processing module 160 serves to improve image quality of thereconstructed picture and includes a deblocking filter module 161, anoffset module 162, and a loop filter module 163.

The deblocking filter module 161 adaptively applies a deblocking filterto boundaries of the prediction block and the transform block. Theboundaries can be limited to boundaries of 8×8 grids. The deblockingfilter module 161 determines the boundaries to be filtered, determinesboundary strengths thereof, and determines whether the deblocking filtershould be applied to the boundaries when the boundary strength is largerthan 0. When it is determined that the boundaries should be filtered,the deblocking filter module 161 selects a filter to be applied to theboundaries and filters the boundaries with the selected filter.

The offset module 162 determines whether an offset should be applied bypictures or slices so as to reduce the distortion between a pixel in theimage undergoing the deblocking filter module and a correspondingoriginal pixel. Alternatively, a slice is divided into plural offsetareas and the offset type of each offset area can be determined. Theoffset type may include a predetermined number of edge offset types andband offset types. When the offset type is an edge offset type, the edgetype to which each pixel belongs is determined and an offsetcorresponding thereto is applied. The edge type is determined on thebasis of the distribution of two pixel values neighboring a currentpixel.

The loop filter module 163 adaptively loop-filters the reconstructedimage on the basis of the comparison result of the reconstructed imageundergoing the offset module 162 with the original image. It isdetermined whether the reconstructed image should be loop-filtered bycoding units. The size and coefficients of the loop filter to be appliedmay changed by the coding units. Information indicating whether theadaptively loop filter should be applied by coding units may be includedin each slice header. In case of a chroma signal, it can be determinedwhether the adaptive loop filter should be applied by pictures.Therefore, information indicating whether chroma components are filteredmay be included in a slice header or a picture header.

The picture buffer 170 receives post-processed image data from thepost-processing module 160 and reconstructs and stores an image in theunit of pictures. The picture may be an image in the unit of frames oran image in the unit of fields.

The entropy encoding module 140 entropy-encodes the quantizationcoefficient information quantized by the transform and quantizationmodule 130, the intra prediction information received from the intraprediction module 140, the motion information received from the interprediction unit 150, and the like. The entropy encoding module 140includes a scanning module 145 which is used to transform coefficientsof the quantized transform block into one-dimensional quantizationcoefficients.

The scanning module 145 determines a scanning type for transforming thecoefficients of the quantized transform block into one-dimensionalquantization coefficients. The scanning type may vary depending on adirectional intra prediction mode and the size of a transform block. Thequantization coefficients are scanned in the backward direction.

When the quantized transform block is larger than a predetermined size,the transform coefficients are divided into plural sub blocks and arescanned. The scanning types applied to the transform coefficients of thesub blocks are the same. The scanning types applied to the sub blocksmay be a zigzag scan or may be the same scanning types as applied to thetransform coefficients of the sub blocks.

FIG. 2 is a block diagram illustrating a moving image decoding device200 according to an embodiment of the invention.

The moving image decoding device 200 according to the embodiment of theinvention includes an entropy decoding module 210, an inversequantization module 220, an inverse transform module 230, an intraprediction module 240, an inter prediction module 250, a post-processingmodule 260, a picture buffer 270, and an addition module 280.

The entropy decoding module 210 decodes a received bit stream andseparates the bit stream into intra prediction information, interprediction information, quantization coefficient information, and thelike therefrom. The entropy decoding module 210 supplies the decodedintra prediction information to the intra prediction module 240 andsupplies the decoded inter prediction information to the interprediction module 250. The entropy decoding module 210 includes aninverse scanning module 215 for inversely scanning the decodedquantization coefficient information.

The inverse scanning module 215 converts the quantization coefficientinformation into a two-dimensional quantization block. One of pluralscanning types is selected for the conversion. The scanning type mayvary depending on a directional intra prediction mode and the size of atransform block. The quantization coefficients are scanned in thebackward direction. When the quantization transform block is larger thana predetermined size, the coefficients are divided into plural subblocks and are scanned. The scanning types applied to the transformcoefficients of the sub blocks are the same. The scanning types appliedto the sub blocks may be a zigzag scan or may be the same scanning typesas applied to the transform coefficients of the sub blocks.

The inverse quantization module 220 determines a quantization step sizepredictor of a current coding unit and adds the determined quantizationstep size predictor to the received residual quantization step size toreconstruct the quantization step size of the current coding unit. Theinverse quantization module 220 inversely quantizes the quantizationblock using the quantization step size and the inverse quantizationmatrix. The quantization matrix is determined depending on the size ofthe quantization block and the prediction mode. That is, thequantization matrix is selected on the basis of at least one of theprediction mode of the current block and the intra prediction modes forthe quantization block having a predetermined size.

The inverse transform module 230 inversely transforms theinversely-quantized transform block to reconstruct a residual block. Theinverse transform matrix to be applied to the inversely-quantized blockcan be determined depending on the prediction mode and the intraprediction mode.

The addition module 280 adds the prediction block created by the intraprediction module 240 or the inter prediction module 250 to the residualblock reconstructed by the inverse transform module 230 to create areconstructed block.

The intra prediction module 240 reconstructs the intra prediction modeof the current block on the basis of the intra prediction informationreceived from the entropy decoding module 210. Then, the intraprediction module 240 creates a prediction block depending on thereconstructed intra prediction mode.

The inter prediction module 250 reconstructs the reference picture indexand the motion vector on the basis of the inter prediction informationreceived from the entropy decoding module 210. Then, the interprediction module 250 creates a prediction block of the current blockusing the reference picture index and the motion vector. When motioncompensation with decimal prediction is applied, a selectedinterpolation filter is applied to create the prediction block.

The operation of the post-processing module 260 is the same as theoperation of the post-processing module 160 shown in FIG. 1 and thuswill not be described again.

The picture buffer 270 stores the decoded image post-processed by thepost-processing module 260 in the unit of pictures.

FIG. 3 is a diagram illustrating a method of creating an intraprediction block in the moving image decoding device 200 according tothe embodiment of the invention.

First, the entropy decoding module 210 entropy-decodes the intraprediction information from the received bit stream (S110).

The intra prediction information includes the intra prediction modegroup indicator and the prediction mode index. The intra prediction modegroup indicator indicates whether the intra prediction mode of thecurrent block belongs to an MPM group or a group other than the MPMgroup. The prediction mode index is information indicating a specificintra prediction mode in the intra prediction mode group indicated bythe intra prediction mode group indicator.

Then, the intra prediction module 240 creates the MPM group using theintra prediction modes of the blocks neighboring the current block andthen reconstructs the intra prediction mode of the current block (S120).The MPM group includes three intra prediction modes. This will bedescribed with reference to FIG. 4. FIG. 4 is a diagram illustratingintra prediction modes according to an embodiment of the invention.

(1) When the intra prediction modes of the top and left blocks of acurrent block are both present and are different from each other, theMPM group includes the two intra prediction modes and one additionalintra prediction mode.

When one of the two intra prediction modes is a DC mode and the other isnot a planar mode, the additional intra prediction mode may be theplanar mode. Similarly, when one of the two intra prediction modes isthe planar mode and the other is not the DC mode, the additional intraprediction mode may be the DC mode.

When the two intra prediction modes are the DC mode and the planar mode,the additional intra prediction mode may be a vertical mode or ahorizontal mode.

When the two intra prediction modes are not the DC mode nor the planarmode, the additional intra prediction mode may be an intra predictionmode having directionality between the two intra prediction modes, orthe DC mode or the planar mode.

(2) When the intra prediction modes of the top and left blocks of thecurrent block are both present and are equal to each other, the MPMgroup includes the intra prediction mode and two additional intraprediction modes.

When the intra prediction mode is neither the DC mode nor the planarmode, the two additional intra prediction modes are set to two intraprediction modes neighboring the intra prediction mode. When the intraprediction mode is the DC mode, the two additional intra predictionmodes may be the planar mode and the vertical mode.

(3) When only one of the intra prediction modes of the top and leftblocks of the current block is present, the MPM group includes the intraprediction mode and two additional intra prediction modes. The twoadditional intra prediction modes are determined depending on the intraprediction mode.

(4) When the intra prediction modes of the top and left blocks of thecurrent block are not present at all, the MPM group includes the DCmode, the planar mode, and the vertical mode.

When the intra prediction mode group indicator indicates the MPM group,the intra prediction module 240 selects the intra prediction modeindicated by the prediction mode index from the MPM group and determinesthe selected intra prediction mode as the intra prediction mode of thecurrent block. The intra prediction mode group indicator may be flaginformation representing whether the intra prediction mode of thecurrent block belongs to the MPM group or a group other than the MPMgroup.

When the intra prediction mode group indicator does not indicates theMPM group, the intra prediction module 240 determines the intraprediction mode indicated by the prediction mode index out of the intraprediction modes (hereinafter, referred to as residual intra predictionmodes) other than the intra prediction modes belonging to the MPM groupas the intra prediction mode of the current block. The prediction modeindices assigned to the residual intra prediction modes vary dependingon the configuration of the MPM group. That is, the decoded predictionmode indices indicate indices of the residual intra prediction modesrearranged depending on the configuration of the MPM group. Therefore,the intra prediction module 240 selects the intra prediction mode of thecurrent block from the residual intra prediction modes depending on thedecoded prediction mode index and the intra prediction modes belongingto the MPM group.

Specifically, the residual intra prediction modes of the current blockare rearranged in the mode number order and the intra prediction modecorresponding to the received prediction mode index is selected as theintra prediction mode of the current block. In this case, the residualintra prediction modes may be rearranged, but the intra prediction modeof the current block may be determined by comparison of the intraprediction mode numbers belonging to the MPM group with the intraprediction mode index of the current block.

This method can be applied to a case where mode number 2 is assigned tothe DC mode of the non-directional modes, mode number 34 is assigned tothe planar mode, and directional mode numbers are assigned to the othermodes. However, since the probability of selecting the planar mode andthe DC mode as the intra prediction mode of the current block is higherthan those of the other directional modes, a small mode number (forexample, mode number 0) is assigned to the planar mode and theabove-mentioned method can be applied. In this case, the mode numbers ofthe other lower-ranked modes increase by 1.

Alternatively, the lowest indices may be assigned to the non-directionalmodes. For example, when the intra prediction mode of the current blockis the planar mode and the residual intra prediction modes include theplanar mode, the intra prediction mode index may include 0. For example,when the residual intra prediction modes include the planar mode and theDC mode, the intra prediction mode corresponding to the prediction modeindex in a state where the planar mode, the DC mode, and the directionalmodes are arranged in this order may be set as the intra prediction modeof the current block. For example, mode number 0 and mode number 1 maybe assigned to the planar mode the DC mode, respectively, or mode number0 and mode number 1 may be assigned to the DC mode and the planar mode,respectively. In this case, the intra prediction mode index of thecurrent block may be compared with the intra prediction mode numbersbelonging to the MPM group to determine the intra prediction mode of thecurrent block.

The intra prediction module 240 determines the size of the predictionblock using information indicating the transform size of the currentblock (S130).

When the size of the prediction block is equal to the size of thecurrent block, the prediction block is created using the intraprediction mode of the current block and the reference pixels of thecurrent block. The reference pixels are pixels reconstructed or createdpreviously to the current block.

When the size of the prediction block is smaller than the size of thecurrent block, that is, when the current block can be divided intoplural sub blocks and the intra prediction is performed thereon, thesame intra prediction mode (that is, the intra prediction mode of thecurrent block) is used to create the prediction block of each sub block.The prediction blocks of the second sub block or sub blocks subsequentthereto in the decoding order are created using the reconstructed pixelsof the preceding sub blocks. Therefore, after the prediction block, theresidual block, and the reconstructed block are created in the units ofsub blocks, the prediction block of the next sub block is created.

The intra prediction module 240 determines whether the reference pixelsof the block corresponding to the size of the prediction block are allvalid (S140). The reference pixels are pixels which are previouslydecoded and reconstructed. When it is determined that at least one ofthe reference pixels is not valid, the reference pixel are created(S150).

Specifically, when it is determined that the reference pixels are notvalid at all, the reference pixel values are replaced with values of2^(L−1). Here, L represents the number of bits representing the grayscale of luma components.

When valid reference pixels are present in only one direction withrespect to the position of the invalid reference pixel, the closestreference pixel out of the valid reference pixels is copied to createthe reference pixels.

When valid reference pixels are present in both directions with respectto the position of the invalid reference pixel, the reference pixellocated at the closest position in a predetermined direction can becopied or two closest reference pixels in both directions can beaveraged to create the reference pixels.

The intra prediction module 240 determines whether the reference pixelsshould be filtered (S160). The reference pixels are adaptively filtereddepending on the reconstructed intra prediction mode and the size of theprediction block (S170).

The intra prediction module 240 does not filter the reference pixelswhen the intra prediction mode is the DC mode. When the intra predictionmodes are the vertical mode and the horizontal mode, the intraprediction module 240 does not also filter the reference pixels.However, when the intra prediction modes are directional modes otherthan the vertical mode and the horizontal mode, the reference pixels areadaptively filtered depending on the intra prediction mode and the sizeof the prediction block. When the size of the prediction block is 4×4,the reference pixels are not filtered for the purpose of a decrease incomplexity regardless of the intra prediction mode. The filtering servesto smooth the variation in pixel value between reference pixels and usesa low-pass filter. The low-pass filter may be [1, 2, 1] which is a 3-tapfilter or [1, 2, 4, 2, 1] which is a 5-tap filter. When the size of theprediction block ranges from 8×8 to 32×32, the reference pixels arefiltered in more intra prediction modes with an increase in the size ofthe prediction block.

The intra prediction module 240 creates the prediction block dependingon the intra prediction mode (S180). The reference pixels used for theprediction block may be pixels which are adaptively filtered dependingon the size of the prediction block and the intra prediction mode.

In the DC mode, the average values of N top reference pixels located atpositions of (x=0, . . . , N−1, y=−1), M left reference pixels locatedat positions of (x=1−, y=0, . . . , M−1), and the corner pixel locatedat a position of (x=−1, y=−1) can be determined as the prediction pixelsof the prediction block. However, the prediction pixels neighboring thereference pixels can be created using weighted average of the averagevalue and the reference pixel neighboring the prediction pixel. In theplanar mode, the prediction pixels can be created in the same was as inthe DC mode.

In the vertical mode, the reference pixels located in the verticaldirection are set to the prediction pixels. However, the predictionpixel neighboring the left reference pixel can be created using thereference pixel located in the vertical direction and the variationbetween the left reference pixels. The variation represents thevariation between the corner reference pixel and the left referencepixel neighboring the prediction pixel. In the horizontal mode, theprediction pixels can be created in the same way as in the verticalmode, except for the direction.

FIG. 5 is a diagram illustrating an intra prediction mode encodingsequence according to an embodiment of the invention. The method ofencoding the intra prediction mode of the current block in the movingimage encoding device shown in FIG. 1 will be described below. Thismethod can be performed by the intra prediction module 110 and theentropy encoding module 140 shown in FIG. 1.

First, the intra prediction mode of the current block is determined(S210).

Then, the MPM group of the current block is created (S220). The methodof creating the MPM group is the same as creating the MPM group in theintra prediction mode 240 shown in FIG. 2 and thus will not bedescribed.

Subsequently, it is determined whether the intra prediction mode of thecurrent block belongs to the MPM group (S230).

When the intra prediction mode belongs to the MPM group, a flag (thatis, the intra prediction mode group indicator) indicating the MPM groupand a prediction mode index indicating a specific intra prediction modein the MPM group are determined (S240).

When the intra prediction mode does not belong to the MPM group, a flagnot indicating the MPM group and the prediction mode index indicatingthe specific intra prediction mode out of intra prediction modes(hereinafter, referred to as residual intra prediction modes) other thanthe intra prediction modes of the MPM group are determined (S250).

The prediction mode index indicating the intra prediction mode of thecurrent block out of the residual intra prediction modes variesdepending on the configuration of the MPM group. That is, the predictionmode indices represent indices of the residual intra prediction modesrearranged depending on the configuration of the MPM group. Therefore,the prediction mode index is determined depending on the intraprediction mode of the current block and the intra prediction modesbelonging to the MPM group.

specifically, the residual intra prediction modes of the current blockcan be rearranged in the mode number order and the order of the intraprediction mode of the current block can be determined as the predictionmode index. Alternatively, the residual intra prediction modes may berearranged, but the intra prediction mode of the current block may bedetermined by comparison of the intra prediction mode numbers belongingto the MPM group with the intra prediction mode index of the currentblock.

This method can be applied to a case where mode number 2 is assigned tothe DC mode of the non-directional modes, mode number 34 is assigned tothe planar mode, and directional mode numbers are assigned to the othermodes. However, since the probability of selecting the planar mode andthe DC mode as the intra prediction mode of the current is higher thanthose of the other directional modes, a small mode number (for example,mode number 0) is assigned to the planar mode and the above-mentionedmethod can be applied. In this case, the mode numbers of the otherlower-ranked modes increase by 1. Alternatively, the lowest indices maybe assigned to the non-directional modes. For example, when the intraprediction mode of the current block is the planar mode and the residualintra prediction modes include the planar mode, the intra predictionmode index may include 0. For example, when the residual intraprediction modes include the planar mode and the DC mode, the intraprediction mode corresponding to the prediction mode index in a statewhere the planar mode, the DC mode, and the directional modes arearranged in this order may be set as the intra prediction mode of thecurrent block. For example, mode number 0 and mode number 1 may beassigned to the planar mode the DC mode, respectively, or mode number 0and mode number 1 may be assigned to the DC mode and the planar mode,respectively. In this case, the intra prediction mode index of thecurrent block may be compared with the intra prediction mode numbersbelonging to the MPM group to determine the intra prediction mode of thecurrent block.

While the invention has been described with reference to theembodiments, it will be able to be understood by those skilled in theart that the invention can be modified and changed in various formswithout departing from the spirit and scope of the invention describedin the appended claims.

The invention claimed is:
 1. A method of encoding an intra predictionmode, the method comprising: determining an intra prediction mode of acurrent block among two non-directional intra prediction modes and aplurality of directional intra prediction modes; constructing a mostprobable mode (MPM) group including three intra prediction modes usingpresented intra prediction modes of left and top blocks of the currentblock; determining a prediction mode index specifying the intraprediction mode of the current block within the MPM group when the intraprediction mode of the current block belongs to the MPM group; anddetermining a prediction mode index specifying the intra prediction modeof the current block among intra prediction modes which are not includedin the MPM group when the intra prediction mode of the current blockdoes not belong to the MPM group, wherein the two non-directional intraprediction modes are a DC mode and a planar mode, wherein a mode numberof the planar mode is lower than mode numbers of the plurality ofdirectional intra prediction modes, wherein when the intra predictionmode of the left block is a DC mode and the intra prediction mode of thetop blocks is the DC mode, the MPM group includes the DC mode, a planarmode and a vertical mode, and wherein lowest prediction mode indices areassigned to the two non-directional intra prediction modes when theintra prediction mode of the current block does not belong to the MPMgroup and the two non-directional intra prediction modes are notincluded in the MPM group.
 2. The method of claim 1, wherein a modenumber 0 is assigned to the planar mode and a mode number 1 is assignedto the DC mode.
 3. The method of claim 1, wherein when the intraprediction modes of the left and top blocks are present, are not equalto each other and are directional intra prediction modes, the MPM groupincludes the intra prediction modes of the left and top blocks and anon-directional intra prediction mode.
 4. The method of claim 3, whereinthe non-directional intra prediction mode is a planar mode.
 5. Themethod of claim 1, wherein when one of the intra prediction modes of theleft and top blocks is a DC mode and the other is not a planar mode, theMPM group includes the intra prediction modes of the left and top blocksand the planar mode.
 6. The method of claim 1, wherein when only one ofthe intra prediction modes of the left and top blocks of the currentblock is present, two additional intra prediction modes are included inthe MPM group and the two additional intra prediction modes aredetermined depending on the present intra prediction mode.
 7. The methodof claim 1, wherein when both of the intra prediction modes of the leftand top block are not present, the MPM group includes the Planar mode,the DC mode and a Vertical mode.